import config from '@/config'
import request from '@/utils/request'

// 登录
export function login(params: Object) {
    return request.post({ url: '/admin.login/login', params: { ...params } })
}

// 退出登录
export function logout() {
    return request.post({ url: '/admin.auth.info/loginOut' })
}


// 用户信息
export function getUserInfo() {
    return request.get({ url: '/auth.admin/mySelf' })
}

// 编辑管理员信息
export function setUserInfo(params: any) {
    return request.post({ url: '/auth.admin/editSelf', params })
}

// 用户等级列表
export function UserRankList(params: any) {
    return request.post({ url: '/admin.auth.user/rankAllList', params })
}

// 用户等级详情
export function UserRankDetail(params: any) {
    return request.post({ url: '/admin.auth.user/rankDetail', params })
}

// 用户等级编辑
export function UserRankEdit(params: any) {
    return request.post({ url: '/admin.auth.user/rankEdit', params })
}

// 消费等级列表
export function levelAllList(params: any) {
    return request.post({ url: '/admin.auth.user/levelAllList', params })
}

// 消费等级详情
export function levelDetail(params: any) {
    return request.post({ url: '/admin.auth.user/levelDetail', params })
}

// 编辑消费等级
export function levelEdit(params: any) {
    return request.post({ url: '/admin.auth.user/levelEdit', params })
}

// 可赠送优惠券列表
export function couponList(params: any) {
    return request.post({ url: '/admin.auth.user/couponList', params })
}

// 封禁账号
export function levelSeal(params: any) {
    return request.post({ url: '/admin.auth.user/levelSeal', params })
}

// 添加消费等级
export function levelAdd(params: any) {
    return request.post({ url: '/admin.auth.user/levelAdd', params })
}


// 获取当前用户的节点权限列表
export function getPermissionList(params: any) {
    return request.post({ url: '/admin.permission.system_user/getPermissionList', params })
}
